package cn.edu.scau.cmi.zhouxinyue.SimpleFactory;

import javafx.fxml.FXML;

import javafx.event.ActionEvent;

import javafx.scene.control.MenuItem;

import javafx.scene.control.TextArea;

import javafx.scene.control.MenuButton;

public class FactoryController {
	@FXML
	private TextArea MInfo;
	@FXML
	private MenuButton CM;
	@FXML
	private MenuItem CHOBeef;
	@FXML
	private MenuItem CHOChicken;
	@FXML
	private MenuItem CHOPork;
	private String meatInfo;
	private String meatType;
	
	public void GiveBeef() {
		CM.setText(CHOBeef.getText());
		meatType="Beef";
		new MeatFactory();
		meatInfo=MeatFactory.getMeatObj(meatType).getMeatInfo();
		MInfo.setText(meatInfo);
	}
	public void GiveChicken() {
		CM.setText(CHOChicken.getText());
		meatType="Chicken";
		meatInfo=MeatFactory.getMeatObj(meatType).getMeatInfo();
		MInfo.setText(meatInfo);
	}
	public void GivePork() {
		CM.setText(CHOPork.getText());
		meatType="Pork";
		meatInfo=MeatFactory.getMeatObj(meatType).getMeatInfo();
		MInfo.setText(meatInfo);
	}
}
